package com.estar.assistsurvy.thread;

import com.estar.assistsurvy.constant.Constants;
import com.estar.assistsurvy.entity.RequestHistory;
import com.estar.assistsurvy.entity.ResponseHistory;

import android.content.Context;
import android.os.Handler;
import android.util.Log;

public class HistoryCaseThread extends BaseThread {

	private RequestHistory requestHistory;

	public HistoryCaseThread(Context context, Handler handler, RequestHistory requestHistory) {
		super(context, handler);
		this.requestHistory = requestHistory;
	}
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		url_str=Constants.NAMESPACE+Constants.HISTORY;
		json=gson.toJson(requestHistory);
		postRequest(url_str, json);
		if(result!=null){
			Log.i("wl", "历史任务返回值"+result);
			ResponseHistory history=new ResponseHistory();
			history=gson.fromJson(result, ResponseHistory.class);
			msg.what=0;
			msg.obj=history;
			msg.sendToTarget();
		}
	}
}
